function OS_Loader(game)
{
	var angles=[
		0,
		Math.PI*0.1,
		Math.PI*0.2,
		Math.PI*0.3,
		Math.PI*-0.1,
		Math.PI*-0.2,
		Math.PI*-0.3,
	];
	var intervalID=null;
	var total=1;
	var loaded=0;
	
	var	getProcessWidth=function()
	{
		return 420*loaded/total;
	}
	
	var drawPoint=function(context,r,angle,len)
	{
		context.save();
		context.translate(game.config.width*0.5,game.config.height*0.5);
		context.rotate(angle);
		context.beginPath();
		context.arc(0,len,r,0,Math.PI*2,true);
		context.fill();
		context.restore();
	}
	
	var frame=function()
	{
		var context=game.stage.getContext();
		context.fillStyle="rgba(255,255,255,1)";
		context.fillRect(0,0,game.config.width,game.config.height);
		
		for (var i=0;i<angles.length;i++)
		{
			var e=Math.abs(Math.sin((angles[i]+Math.PI)/2))*0.1+Math.PI*0.01;
			angles[i]+=e;
			if (i<angles.length-1 && angles[i+1]-angles[i]<Math.PI*0.1) angles[i]=angles[i+1]-Math.PI*0.1;
			context.fillStyle="rgba(70,70,70,"+(Math.sin((angles[i])/4)>0?Math.sin((angles[i])/4):0)+")";
			drawPoint(context,4,angles[i],40);
			if (Math.sin((angles[i])/4)<-0.8){angles[i]+=Math.PI;}
		}
		context.fillStyle="rgba(210,210,210,1)";
		context.fillRect(game.config.width*0.5-210,game.config.height*0.5+150,getProcessWidth(),20);
		context.strokeStyle="rgba(190,190,190,1)";
		context.lineWidth=2;
		context.strokeRect(game.config.width*0.5-210,game.config.height*0.5+150,420,20);
		game.stage.write({content:"Loading",align:"center",size:20,color:"rgba(70,70,70,1)",bold:true},game.config.width*0.5,game.config.height*0.5+80);
		game.stage.write({content:"Powered By MovingCastle©",align:"right",baseline:"bottom",size:12,color:"rgba(60,60,60,1)"},game.config.width-20,game.config.height-30);
	}
	
	this.start=function()
	{
		//angle1=Math.random()*Math.PI*2;
		//angle2=Math.random()*Math.PI*2;
		//angle3=Math.random()*Math.PI*2;
		//angle4=Math.random()*Math.PI*2;
		//game.stage.clear("#fff");
		intervalID=window.setInterval(frame,20);
		lastProcessTime=(new Date()).getTime();
	}
	
	this.process=function(p)
	{
		loaded=p.loaded;
		total=p.total;
	}
	
	this.stop=function()
	{
		window.clearInterval(intervalID);
		game.stage.clear("#fff");
	}
}
